﻿@model GiftCardUsageHistoryModel

@{
    var parentModel = ViewData["Parent"] as GiftCardModel;
}

<datagrid id="gift-card-usage-history-grid" class="h-100"
          key-member="Id"
          allow-resize="true"
          allow-column-reordering="false"
          preserve-grid-state="true"
          max-height="650px">
    <datasource read="@Url.Action("GiftCardUsageHistoryList", new { id = parentModel.Id })" />
    <paging position="Top" show-size-chooser="true" />
    <sorting allow-unsort="true" allow-multisort="false">
        <sort by="CreatedOn" descending="true" />
    </sorting>
    <columns>
        <column for="UsedValue" width="auto" />
        <column for="CreatedOn" entity-member="CreatedOnUtc" />
        <column for="OrderId" hideable="false" width="1fr" entity-member="UsedWithOrderId">
            <display-template>
                <div class="text-truncate"><a :href="item.row.OrderEditUrl" class="text-truncate">{{ item.row.OrderEditLinkText }}</a></div>
            </display-template>
        </column>
    </columns>
</datagrid>